package com.sky.controller.admin;

import com.sky.entity.Category;
import com.sky.result.Result;
import com.sky.service.GategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/admin/category")
public class CategoryController {

    @Autowired
    private GategoryService gategoryService;



    //根据类型查询分类
    @GetMapping("/list")
    public Result<List<Category>> list(Integer type){
       log.info("根据类型查询分类：{}",type);
      List<Category> list = gategoryService.list(type);

        return Result.success(list);
    }


}
